<template>
  <div>
  <div class="demo-nav">
    <i class="van-icon van-icon-arrow-left van-nav-bar__arrow" style="left: -115px;font-size: 20px" @click="goBack"></i>
    <div class="demo-nav__title" style="margin-left: -10px">{{form.nameto}}</div>
  </div>
    <div>
      <el-popover
          placement="right"
          width="400"
          trigger="click">
        <el-form ref="form" :model="form" label-width="120px">
          <el-form-item label="留言标题">
            <el-input v-model="form.title" style="width: 120px"></el-input>
          </el-form-item>
          <el-form-item label="留言内容">
            <el-input type="textarea" v-model="form.detail"></el-input>
          </el-form-item>
          <el-form-item>
            <el-button type="primary" @click="onSubmit">发送</el-button>
            <el-button>取消</el-button>
          </el-form-item>
        </el-form>
        <el-button slot="reference">click 激活</el-button>
      </el-popover>

    </div>
  </div>
</template>

<script>
export default {
  name: "SendLetter",
  data(){
    return{
      form:{
        nameto:'cyy',
        namefrom:'zxh',
        title:'',
        detail:'',
      },
      value:'',
    }
  },
  methods:{
    onSubmit(){
      var _this = this
      _this.axios({
        method:'post',
        url:'/message/AddMessage',
        data:_this.form,
      }).then(function (){
        _this.$router.go(-1)
      })
    },
    SetValue(e){
      console.log(e)
      this.form.title = e
    }
  },
  created() {
    var _this = this
    _this.form.nameto = _this.$route.query.nameto
    _this.form.namefrom = _this.$route.query.namefrom
  }
}
</script>

<style scoped>

</style>